package com.clwl.supervise.superviseapp.controller.inspection;


import com.clwl.supervise.superviseapp.entity.base.CommonSearchEntity;
import com.clwl.supervise.superviseapp.entity.result.ResultEntity;
import com.clwl.supervise.superviseapp.service.inspect.SpotCheckService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 抽检信息查询
 */
@RestController
@RequestMapping("/spotCheck")
public class SpotCheckController {



    @Resource
    private SpotCheckService spotCheckService;

    /**
     * 获取抽样列表信息
     * @param pageNum 当前页数
     * @param pageSize 每页数据数量
     * @return
     */
    @GetMapping("spotCheckList")
    public ResultEntity<List<Map<String,Object>>> spotCheckList(Integer pageNum, Integer pageSize, CommonSearchEntity commonSearchEntity ) {
        List<Map<String,Object>> pageList = spotCheckService.selectPage(pageNum,pageSize, commonSearchEntity );
        return ResultEntity.success(pageList);
    }

    /**
     * 获取抽样列表信息
     * @param xkzbh
     * @param yyzzh
     * @return
     */
    @GetMapping("spotCheckGetCompany")
    public ResultEntity<Map<String,Object>> spotCheckGetCompany(String xkzbh, String yyzzh ) {
        Map<String,Object> pageList = spotCheckService.spotCheckGetCompany(xkzbh,yyzzh );
        return ResultEntity.success(pageList);
    }




}
